package com.wuyou.designPatterns.builder;

import com.wuyou.designPatterns.builder.framework.AbstractBuilder;
import com.wuyou.designPatterns.builder.framework.Document;

/**
 *
 */
public class Director {
    private AbstractBuilder<Document> abstractBuilder;

    public Director(AbstractBuilder<Document> abstractBuilder){
        this.abstractBuilder = abstractBuilder;
    }

    public Document construct(){
        return abstractBuilder.buildTitle("title")
                .buildContent("content")
                .buildFoot("foot")
                .build();

    }

    public String display(){
        return construct().toString();
    }
}
